import request from '@/utils/request.js'

export function addShipper(data){
  return request.post('/addShipper',data)
}

export function getShipperById(id){
  return request.get('/getShipperById?id='+id)
}

// 更新快递信息
export function updateShipper(data){
  return request.post('/updateShipper',data)
}

// 获取快递列表
export function getShipperList(data){
  return request.post('/getShipperList',data)
}

// 删除快递

export function deleteShipper(data){
  return request.post('/deleteShipper',data)
}

// 获取快递模板
export function getFreightTemplateList(data){
  // console.log('qs(data):',qs.stringify(data))
  // let queryStr = data ?  '?'+qs.stringify(data) : ''
  // return request.get(`/getFreightTemplateList`,data)
  return request({
    url:`/getFreightTemplateList`,
    data
  })
}

//根据查询条件获取快递列表
export function getShipperListByQuery(data){
  return request({
    url:'/getShipperListByQuery',
    data
  })
}

// 获取快递发件人
export function getSenderData(){
  return request.get('/getSenderData')
}

// 保存发件人
export function saveSenderData(data){
  return request.post('/saveSenderData',data)
}